<template>
	<div @click.stop="onClickHandler()" :class="[selected ?'row-selected-state' : 'row-normal-state']"
		style="width: 100%;position: relative;">
		<div style="font-size: 20px;font-weight: bold;">单据号:BG-2022040000001</div>
		<div style="position: absolute;right: 0px;top: 0px;font-size: 12px;display: flex;align-items: center;">
			<span>创建人</span>
			<el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" size="small"></el-avatar>
			<span>豪客</span>
		</div>
	</div>
</template>

<script>
	import utils from '@/utils/utils.js';
	import formDesignerUtil from '@/utils/formDesignerUtil.js';
	export default {
		name: "DesignTitleComponent",
		props: [
			"componentModel"
		],
		data() {
			return {
				selected: false,
				"propertySet": [{
					"key": "ID",
					"label": "ID",
					"editor": "label"
				}]
			}
		},
		inject: ['children'],
		mounted() {
			this.children.push(this);
		},
		beforeUnmount() {
			utils.removeArrayElement(this.children, this);
		},
		methods: {
			onClickHandler() {
				formDesignerUtil.componentClickHandler(this);
			},
			setSelected(selected) {
				this.selected = selected;
			},
			getPropertyValue(propertyKey) {
				if(propertyKey=="ID"){
					return formDesignerUtil.getComponentModelPropValue(this.componentModel,"id");
				}
				return formDesignerUtil.getComponentModelCommonValue(this.componentModel,propertyKey);
			},
			setPropertyValue(propertyKey, propertyValue) {
				formDesignerUtil.setComponentModelCommonValue(this.componentModel,propertyKey, propertyValue);
			}
		}
	}
</script>

<style>

</style>
